#include "Defines.h"
#include "Engine.h"
#include "SocketCommunicator.h"
#include "ServerHandler.h"
#include <irrlicht.h>
#include <EDriverTypes.h>
#include "Init.h"


//#ifdef NOLAUNCHER
	#ifdef _WIN32
	#include "windows.h"
	#include <stdio.h>
	#include <shellapi.h>
	int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
	#else
	int main(int argc, char *argv[])
	#endif
	{
		init();
		return 0;
	}
/*
#else
#ifdef _WIN32
#include "windows.h"

#define szClassName L"mainWndClass"
#define szTitle L"Akuma II 0.1"
#define WIDTH 250
#define HEIGHT 300

LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch(msg)
	{
		case WM_CREATE:
			CreateWindow(L"BUTTON", 
						L"Launch", 
						WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 
						WIDTH-100, HEIGHT-65, 88, 25,
						hwnd, NULL, NULL, NULL);
		break;
		case WM_COMMAND:		
			ShowWindow(hwnd, FALSE);

			//Gaem time
			init();
			//Gaem time over

			DestroyWindow(hwnd);
		break;
		case WM_CLOSE:
			DestroyWindow(hwnd);
		break;
		case WM_DESTROY:
			PostQuitMessage(0);
		break;
		default:
			return DefWindowProc(hwnd, msg, wParam, lParam);
	}
	return 0;
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	WNDCLASSEX wc;
	HWND hwnd;
	MSG Msg;

	wc.cbSize		 = sizeof(WNDCLASSEX);
	wc.style		 = 0;
	wc.lpfnWndProc	 = WndProc;
	wc.cbClsExtra	 = 0;
	wc.cbWndExtra	 = 0;
	wc.hInstance	 = hInstance;
	wc.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
	wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
	wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
	wc.lpszMenuName  = NULL;
	wc.lpszClassName = szClassName;
	wc.hIconSm       = LoadIcon(NULL, IDI_APPLICATION);
	RegisterClassEx(&wc);

	hwnd = CreateWindow(szClassName,
						szTitle,
						WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX,
						CW_USEDEFAULT, CW_USEDEFAULT, WIDTH, HEIGHT,
						NULL, NULL, hInstance, NULL);

	ShowWindow(hwnd, nCmdShow);
	UpdateWindow(hwnd);

	while(GetMessage(&Msg, NULL, 0, 0) > 0)
	{
		TranslateMessage(&Msg);
		DispatchMessage(&Msg);
	}

	return 0;
}
#else
#include <iostream>
int main()
{
	video::E_DRIVER_TYPE driverType = video::EDT_OPENGL;

	std::cout << "Please select the driver you want for this example:\n"\
                " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
                " (d) Software Renderer\n (e) Burning's Software Renderer\n"\
                " (f) NullDevice\n (otherKey) exit\n\n";
	char i;
    std::cin >> i;

    switch(i)
    {
            case 'a': 
				driverType = video::EDT_DIRECT3D9;
			break;
            case 'b':
				driverType = video::EDT_DIRECT3D8;
				break;
            case 'c':
				driverType = video::EDT_OPENGL;
			break;
            case 'd':
				driverType = video::EDT_SOFTWARE;
			break;
            case 'e':
				driverType = video::EDT_BURNINGSVIDEO;
			break;
            case 'f':
				driverType = video::EDT_NULL;
			break;
            default: return 0;
    }

	engine(driverType);

	return 0;
}
#endif*/
